# This file is to transfer names of county into numbers.

BEGIN {
  FS = ","
  OFS = ","
}

{
  if (NR == 1) {
    for (i = 1; i<=NF; ++i) 
      code[$i] = i
  }

  for (i = 1; i<=NF; ++i) {
    sub (/County.*$/, "", $i)
    if ($i ~ /^$/)
      $i = 0
    if ($i in code)
      $i = code[$i]
    
  }
  print $0
}
